package com.bite.friend.Controller;

import com.bite.friend.Aspect.CheckUserStatus;
import com.bite.friend.DTO.UserExamListDTO;
import com.bite.friend.Service.UserExamService;
import domain.R;
import domain.TableDataInfo;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.annotation.Documented;

@RestController
@RequestMapping("/userExam")
/**
 * 用户竞赛模块
 */
public class UserExamController {

    @Autowired
    private UserExamService userExamService;

    /**
     * 报名竞赛
     * @param examId
     * @return
     */
    @CheckUserStatus
    @GetMapping("/enter")
    public R<Void> enter(String examId) {
        return userExamService.enter(examId);
    }

    /**
     * 查询用户个人竞赛列表
     * @return
     */
    @GetMapping("/singleUserList")
    public TableDataInfo ExamList(UserExamListDTO userExamListDTO) {
        return userExamService.singleUserList(userExamListDTO);
    }
}
